package com.cskaoyan.config;

import com.cskaoyan.dao.UserDao;
import com.cskaoyan.dao.UserDaoImpl;
import com.cskaoyan.service.OrderServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @author stone
 * @date 2022/07/06 09:41
 */
@Configuration
@ComponentScan("com.cskaoyan")
@Import(OrderServiceImpl.class)
public class SpringConfiguration {

    // 现在容器中UserDao类型的组件有几个？
    // → @Repository注解注册的
    // → 这里@Bean注解注册的
    @Bean
    public UserDao userDao2() {
        return new UserDaoImpl();
    }
}
